<template>
  <div class="lan-search-form-container">
    <lan-form
      :config="config"
      :formData="formData"
    >
      <template
        v-for="item in config.formList.filter((item) => item.type === 'slot')"
        #[item.name]
      >
        <slot
          :name="item.name"
          :data="formData"
        ></slot>
      </template>
    </lan-form>
    <div>
      <el-button
        size="small"
        type="primary"
        icon="el-icon-search"
        @click="$emit('search')"
        :loading="config.btnLoading"
      >查询</el-button>
    </div>
  </div>
</template>

<script>
import lanForm from './lanForm';

export default {
  components: { lanForm },
  props: {
    config: {
      type: Object,
      default: () => {}
    },
    size: {
      type: String
    },
    formData: {
      type: Object,
      default: () => {}
    }
  }
};
</script>

<style lang="scss" scoped>
.lan-search-form-container {
  padding: 10px 10px 0 10px;
  background-color: #fff;
  margin-bottom: 10px;
  display: flex;
  flex-direction: row;
  .el-form {
    display: flex;
    align-items: center;
  }
  .el-form--inline .el-form-item {
    margin-right: 0;
  }
  /deep/.el-form-item {
    margin-right: 10px;
    border-bottom: 0px !important;
    .el-select {
      width: 180px;
    }
    .el-input {
      width: 180px;
    }
  }
  .el-button--primary {
    margin-top: 5px;
    border: 1px solid red;
    margin-left: 0px;
    background-color: #2c83b1;
    border-color: #2c83b1;
  }
}
</style>

